package com.wx.activitframework.dao;

import java.util.List;

import com.wx.activitframework.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;


public interface RoleDao extends JpaRepository<Role, Integer>{
	
	@Query(value="select r.* from sys_user u,sys_user_role ur,sys_role r where u.id=ur.role_id and ur.role_id=r.id and u.user_name=?1",nativeQuery=true)
	List<Role> getRolesByUserName(String userName);

}
